package com.huc.tools.tools.exception;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * @Author: 胡成
 * @Version: 0.0.1V
 * @Date: 2018/8/10
 * @Description: 类描述
 **/
public class ExceptionTools {

    public static String getStackTrace(Throwable t){
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        try{
            t.printStackTrace();
            return sw.toString();
        }finally {
            pw.close();
        }
    }
}
